home *** CD-ROM | disk | FTP | other *** search
- Path: news3.digex.net!usenet
- From: bablank@access.digex.net (Bruce Blank)
- Newsgroups: comp.lang.c++
- Subject: HELP! How Do I Get A Long File Name From Short Name?
- Date: 29 Mar 1996 01:57:51 GMT
- Organization: Express Access Online Communications, USA
- Message-ID: <4jfg2v$e1c@news3.digex.net>
- NNTP-Posting-Host: dcd00222.slip.digex.net
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.2
-
- Hello All,
-
- I'm trying to get a long file name from a short file name. I've tried
- using GetFullPathName but couldn't get it to work. An extract from my
- program is included below. What I really want to do is convert a short
- path name to a long path name such as:
-
- "c:\windows\startm~1\progra~1\window~1.lnk"
-
- to
-
- "c:\windows\Start Menu\Programs\Windows Explorer.lnk"
-
- Can anyone suggest the best (or any) way to do this. I'm new to
- Windows 95 and Visual C++ 4.0 (and not exactly a C++ guru yet) and not
- sure how this long file name business is handled programatically. Thanks
- in advance for your help.
-
- Regards... Bruce Blank
-
- ====================================================================
-
- HRESULT GetLinkInfo(HWND hWnd, char *lpszLinkName, char *pszOutName)
-
- {
- .
- .
- .
- char szLongFileName[128];
- char * lpszLongFileName;
- lpszLongFileName = szLongFileName;
- .
- .
- .
- GetFullPathName(lpszLinkName, MAX_PATH, szLongFileName,
- &lpszLongFileName);
- .
- .
- .
- (then try to write result to file which still reflects short name!)
- .
- .
- }
-
- - -
- ======================================================
- * Bruce Arlan Blank *
- * -------------------------------------------------- *
- * email: bablank@access.digex.net *
- * WWW page: http://www.access.digex.net:80/~bablank/ *
- ======================================================
-
-